package com.cleaningcloud.cld.service.impl;

import java.util.List;
import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cleaningcloud.cld.mapper.CldDegreetitleProblemMapper;
import com.cleaningcloud.cld.domain.CldDegreetitleProblem;
import com.cleaningcloud.cld.service.ICldDegreetitleProblemService;

/**
 * 满意度问题Service业务层处理
 * 
 * @author cleaningcloud
 * @date 2024-10-27
 */
@Service
public class CldDegreetitleProblemServiceImpl implements ICldDegreetitleProblemService 
{
    @Autowired
    private CldDegreetitleProblemMapper cldDegreetitleProblemMapper;

    /**
     * 查询满意度问题
     * 
     * @param degreetitleProblemId 满意度问题主键
     * @return 满意度问题
     */
    @Override
    public CldDegreetitleProblem selectCldDegreetitleProblemByDegreetitleProblemId(Long degreetitleProblemId)
    {
        return cldDegreetitleProblemMapper.selectCldDegreetitleProblemByDegreetitleProblemId(degreetitleProblemId);
    }

    /**
     * 查询满意度问题列表
     * 
     * @param cldDegreetitleProblem 满意度问题
     * @return 满意度问题
     */
    @Override
    public List<CldDegreetitleProblem> selectCldDegreetitleProblemList(CldDegreetitleProblem cldDegreetitleProblem)
    {
        return cldDegreetitleProblemMapper.selectCldDegreetitleProblemList(cldDegreetitleProblem);
    }

    /**
     * 新增满意度问题
     * 
     * @param cldDegreetitleProblem 满意度问题
     * @return 结果
     */
    @Override
    public int insertCldDegreetitleProblem(CldDegreetitleProblem cldDegreetitleProblem)
    {
        cldDegreetitleProblem.setCreateTime(DateUtils.getNowDate());
        cldDegreetitleProblem.setCreateName(SecurityUtils.getUsername());
        cldDegreetitleProblem.setCreateId(SecurityUtils.getUserId());
        cldDegreetitleProblem.setFlag(0L);
        return cldDegreetitleProblemMapper.insertCldDegreetitleProblem(cldDegreetitleProblem);
    }

    /**
     * 修改满意度问题
     * 
     * @param cldDegreetitleProblem 满意度问题
     * @return 结果
     */
    @Override
    public int updateCldDegreetitleProblem(CldDegreetitleProblem cldDegreetitleProblem)
    {
        return cldDegreetitleProblemMapper.updateCldDegreetitleProblem(cldDegreetitleProblem);
    }

    /**
     * 批量删除满意度问题
     * 
     * @param degreetitleProblemIds 需要删除的满意度问题主键
     * @return 结果
     */
    @Override
    public int deleteCldDegreetitleProblemByDegreetitleProblemIds(Long[] degreetitleProblemIds)
    {
        return cldDegreetitleProblemMapper.deleteCldDegreetitleProblemByDegreetitleProblemIds(degreetitleProblemIds);
    }

    /**
     * 删除满意度问题信息
     * 
     * @param degreetitleProblemId 满意度问题主键
     * @return 结果
     */
    @Override
    public int deleteCldDegreetitleProblemByDegreetitleProblemId(Long degreetitleProblemId)
    {
        return cldDegreetitleProblemMapper.deleteCldDegreetitleProblemByDegreetitleProblemId(degreetitleProblemId);
    }
}
